<template>
  <div>
    <i class="el-icon-full-screen btnScreen" @click="toggleScreen" />
  </div>
</template>

<script>
import screenfull from 'screenfull'
export default {
  methods: {
    toggleScreen() {
      if (!screenfull.isEnabled) {
        this.$message.error('当前环境不支持全屏')
      } else {
        screenfull.toggle()
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.btnScreen {
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
</style>
